﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ContentListView : IUIView
{
    public Button taskbtn, bagbtn, settingbtn, returnMainbtn, returnbtn;

    public override void Initinalize()
    {
        returnMainbtn.onClick.AddListener(ReturnMainScene);
        returnbtn.onClick.AddListener(Hide);
        settingbtn.onClick.AddListener(OpenSettingPanel);
        Hide();
    }

    public void OpenSettingPanel()
    {
        Hide();
        UIManager.Instance.audioSettingPanel.Show();
        
    }

    public void ReturnMainScene()
    {
        UIManager.Instance.combatView.Hide();
        Hide();
        UIManager.Instance.combatView.ResetView();
        GameManager.Instance.AsyncLoadScene("GameMain",()=> { UIManager.Instance.setBg(true);  UIManager.Instance.mainPanel.Show(); Destroy(GameManager.Instance.PlayerCtrl.gameObject); });
    }
}
